<?php
class PostsControllerEvents extends AppControllerEvents {
    private $_name = 'PostsController';
    public function onAfterPostAdd($event){
        $event->Activity->add(array(
            'user' => $event->user,
            'content' => __('user :user added new post :title', true),
            'url' => array('controller'=>'posts', $event->id),
            'params' => array('title'=>$event->title)
        ));
    }
    public function onAfterPostEdit($event){
        $event->Activity->add(array(
            'user' => $event->user,
            'content' => __('user :user updated post :title', true),
            'url' => array('controller'=>'posts', $event->id),
            'params' => array('title'=>$event->title)
        ));
    }
}

?>
